<%--
 *  File:    org.jsp
 *  @Author: KentZhong
 *  Date:    2002/07/30
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.org");
  String privilegeCode = "10101";
  String strModuleName = "OGM";
%>


 <%
    HashMap CurUserInfo=(HashMap)session.getAttribute("userinfo");
    if(CurUserInfo==null)
        CurUserInfo=new HashMap();
    cat.debug("CurUserInfo is:"+CurUserInfo);
    String contentRoot = request.getContextPath();
 %>

<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%
    String strOrgid=request.getParameter("orgid");
    String strNewchild=request.getParameter("newchild");
    String strGlobalpccode=request.getParameter("globalpccode");
    String strLanguagecode=request.getParameter("languagecode");
    String displayflag="";
    String strParentorgid=request.getParameter("parentorgid");
    String strGrade=request.getParameter("grade");
    String strInfo=request.getParameter("info");
    if(request.getParameter("info")!=null)
	{
	  displayflag="view";
	}
    String strParam="";
    if( strLanguagecode==null)
        strLanguagecode="cn";
    strParam+="&languagecode="+strLanguagecode;
    if(strOrgid!=null)
        strParam+="&orgid="+strOrgid;
    if(strNewchild!=null)
        strParam+="&newchild="+strNewchild;

    HashMap relationinfo = (HashMap)pageContext.getAttribute("relationinfo");
    if(relationinfo == null)
      relationinfo = new HashMap();
    Integer gbcode = (Integer)relationinfo.get("globalpccode");
    if(gbcode == null)
      gbcode = new Integer(-1);

	  String IsExternal = (String)session.getAttribute("IsExternal");
%>
<html>
<head>
<title>org</title>
<%if(strOrgid!=null){%>
<PageFlow:CheckPageFlow pageName="org"/>
<%}%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="javascript">
function page_none()
{
    alert('<%=message.getMessageDesc("SAVE_INFO_FIRST")%>');
    return;
}
function page_back()
{
  if(parent.opener != null)
    window.close();
  else
    parent.location.href = "OrgSummary.jsp?<%= OvalTools.randomURL() %>&orgid=<%=JspHelper.filterNull(strOrgid)%>&languagecode=<%=strLanguageCode%>";
}

function clicked(obj){
var type=obj.id;
<%if(strOrgid!=null){%>
        if (type == "A01"){
            <%if(strInfo!=null && strInfo.equalsIgnoreCase("Y")){%>
               parent.down1.location.href="OrgInfo.jsp?<%= OvalTools.randomURL() %>&orgid=<%=JspHelper.filterNull(strOrgid)%>&languagecode=<%=strLanguageCode%>";
           <%}else{%>
               parent.down1.location.href="OrgEdit.jsp?<%= OvalTools.randomURL() %><%=JspHelper.filterNull(strParam )%>";
           <%}%>
         }
    <%}else{%>
        page_none();
    <%}%>
}
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <form name="cform" method="post" action="../../Dispatcher">
      <input type="hidden" name="pagename" value="org">
      <input type="hidden" name="actionname">
      <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
      


 <%
 strLanguagecode=strLanguageCode;
 Integer orgpccode = new Integer(-1);
 if(strOrgid!=null)
 {
    String strOrgNewChild=(String)pageContext.getAttribute("newchild");
    String strOrgShowInfo=(String)pageContext.getAttribute("info");
    HashMap orginfo=(HashMap)pageContext.getAttribute("orginfo");
    if(orginfo == null)
      orginfo = new HashMap();
    if(orginfo.get("globalpccode") != null)
      orgpccode = (Integer)orginfo.get("globalpccode");


    if(strGlobalpccode ==null && orginfo.get("globalpccode") != null)
      strGlobalpccode = orginfo.get("globalpccode").toString();
    strParam+="&globalpccode="+strGlobalpccode;

    if(strParentorgid!=null)
        strParam+="&parentorgid="+strParentorgid;
    else if(orginfo.get("parentorgid")!=null)
        strParam+="&parentorgid="+orginfo.get("parentorgid");

    if(strGrade!=null)
        strParam+="&grade="+strGrade;
    else if(orginfo.get("grade")!=null)
        strParam+="&grade="+orginfo.get("grade");


 %>
      <input type="hidden" name="info" value="<%=JspHelper.filterNull((strInfo==null)?"":strInfo)%>">
      <input type="hidden" name="orgid" value="<%=JspHelper.filterNull((strOrgid==null)?"":strOrgid)%>">
      <input type="hidden" name="newchild" value="<%=JspHelper.filterNull((strNewchild==null)?"":strNewchild)%>">

      <input type="hidden" name="globalpccode" value='<oval:write name="orginfo" property="globalpccode"/>'>
      <input type="hidden" name="parentorgid" value='<oval:write name="orginfo" property="parentorgid"/>'>
      <input type="hidden" name="grade" value='<oval:write name="orginfo" property="grade"/>'>

 <%}%>

<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" height="19">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="summary_top" ></td>
        </tr>
      </table>
    </td>
  </tr>


  <tr>
    <td>
        <%
            Vector vec = new Vector();
            HashMap tabHash = new HashMap();
            tabHash.put("id","A01");
            tabHash.put("label","L_BasicInfo");
            vec.add(new HashMap(tabHash));

        %>
       <custom:tab  vecAttr="<%=vec%>" defaultID="A01" />

    </td>
  </tr>


</table>
</form>
</body>
</html>


